gpt-5-nanoのレスポンスが正しいJSONを返さないのでstructured outputsを使った
from 画像からカレンダーに予定を登録するdiscord botを作る
こんなのを返してきた
code:zsh
`...
(error) Error stack: Error: Invalid JSON response from OpenAI: `json
[
{
"summary": "神社でのイベント",
"start": "2025-09-17T17:00:00+09:00",
"end": "2025-09-17T18:00:00+09:00",
"location": "神社"
}
]
`...
at OpenAIService.parseEventFromText (index.js:8603:15)
at async processTextInBackground (index.js:8850:20)
Structured Outputsで解決した
API に Structured Outputs を導入 | OpenAI